using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class PCINowHistoryMap : EntityTypeConfiguration<PCINowHistory>
    {
        public PCINowHistoryMap()
        {
            // Primary Key
            this.HasKey(t => t.Now_History_Id);

            // Properties
            this.Property(t => t.patient_id)
                .HasMaxLength(20);

            this.Property(t => t.create_by)
                .HasMaxLength(20);

            this.Property(t => t.update_by)
                .HasMaxLength(20);

            this.Property(t => t.InPathWays)
                .HasMaxLength(20);

            this.Property(t => t.VisitMethods)
                .HasMaxLength(20);

            this.Property(t => t.InSymptomShock)
                .HasMaxLength(20);

            this.Property(t => t.InSymptomArrhythmia)
                .HasMaxLength(20);

            this.Property(t => t.InSymptomChestPain)
                .HasMaxLength(50);

            this.Property(t => t.ClinicalDiagnose)
                .HasMaxLength(200);

            this.Property(t => t.OtherDiagnose)
                .HasMaxLength(200);

            this.Property(t => t.GRACE_Killip)
                .HasMaxLength(20);

            this.Property(t => t.GRACE_STSegChange)
                .HasMaxLength(20);

            this.Property(t => t.GRACE_CardiacArrest)
                .HasMaxLength(20);

            this.Property(t => t.GRACE_SerumCreatinine)
                .HasMaxLength(20);

            this.Property(t => t.GRACE_cTNI)
                .HasMaxLength(20);

            this.Property(t => t.GRACE_CK_MB)
                .HasMaxLength(20);

            this.Property(t => t.GRACE_ScoringResults)
                .HasMaxLength(20);

            this.Property(t => t.GRACE_CriticalType)
                .HasMaxLength(20);

            this.Property(t => t.CRUSADE_CreatinineClearance)
                .HasMaxLength(20);

            this.Property(t => t.CRUSADE_BaselineHematocrit)
                .HasMaxLength(20);

            this.Property(t => t.CRUSADE_HeartFailureSigns)
                .HasMaxLength(20);

            this.Property(t => t.CRUSADE_ScoringResults)
                .HasMaxLength(20);

            this.Property(t => t.CRUSADE_Probability)
                .HasMaxLength(20);

            this.Property(t => t.CRUSADE_CriticalType)
                .HasMaxLength(20);

            this.Property(t => t.ECGCheck_STSegImprove)
                .HasMaxLength(20);

            this.Property(t => t.ECGCheck_STRange)
                .HasMaxLength(20);

            this.Property(t => t.ChronicHeartFailure)
                .IsFixedLength()
                .HasMaxLength(4);

            this.Property(t => t.VascularDisease)
                .IsFixedLength()
                .HasMaxLength(4);

            // Table & Column Mappings
            this.ToTable("PCINowHistory");
            this.Property(t => t.Now_History_Id).HasColumnName("Now_History_Id");
            this.Property(t => t.patient_id).HasColumnName("patient_id");
            this.Property(t => t.follow_up_id).HasColumnName("follow_up_id");
            this.Property(t => t.create_time).HasColumnName("create_time");
            this.Property(t => t.create_by).HasColumnName("create_by");
            this.Property(t => t.update_time).HasColumnName("update_time");
            this.Property(t => t.update_by).HasColumnName("update_by");
            this.Property(t => t.HappenTime).HasColumnName("HappenTime");
            this.Property(t => t.IntoTime).HasColumnName("IntoTime");
            this.Property(t => t.InPathWays).HasColumnName("InPathWays");
            this.Property(t => t.VisitMethods).HasColumnName("VisitMethods");
            this.Property(t => t.InSymptomShock).HasColumnName("InSymptomShock");
            this.Property(t => t.InSymptomArrhythmia).HasColumnName("InSymptomArrhythmia");
            this.Property(t => t.InSymptomChestPain).HasColumnName("InSymptomChestPain");
            this.Property(t => t.ClinicalDiagnose).HasColumnName("ClinicalDiagnose");
            this.Property(t => t.OtherDiagnose).HasColumnName("OtherDiagnose");
            this.Property(t => t.GRACE_Killip).HasColumnName("GRACE_Killip");
            this.Property(t => t.GRACE_STSegChange).HasColumnName("GRACE_STSegChange");
            this.Property(t => t.GRACE_CardiacArrest).HasColumnName("GRACE_CardiacArrest");
            this.Property(t => t.GRACE_SerumCreatinine).HasColumnName("GRACE_SerumCreatinine");
            this.Property(t => t.GRACE_cTNI).HasColumnName("GRACE_cTNI");
            this.Property(t => t.GRACE_CK_MB).HasColumnName("GRACE_CK_MB");
            this.Property(t => t.GRACE_ScoringResults).HasColumnName("GRACE_ScoringResults");
            this.Property(t => t.GRACE_CriticalType).HasColumnName("GRACE_CriticalType");
            this.Property(t => t.CRUSADE_CreatinineClearance).HasColumnName("CRUSADE_CreatinineClearance");
            this.Property(t => t.CRUSADE_BaselineHematocrit).HasColumnName("CRUSADE_BaselineHematocrit");
            this.Property(t => t.CRUSADE_HeartFailureSigns).HasColumnName("CRUSADE_HeartFailureSigns");
            this.Property(t => t.CRUSADE_ScoringResults).HasColumnName("CRUSADE_ScoringResults");
            this.Property(t => t.CRUSADE_Probability).HasColumnName("CRUSADE_Probability");
            this.Property(t => t.CRUSADE_CriticalType).HasColumnName("CRUSADE_CriticalType");
            this.Property(t => t.ECGCheck_STSegImprove).HasColumnName("ECGCheck_STSegImprove");
            this.Property(t => t.ECGCheck_STRange).HasColumnName("ECGCheck_STRange");
            this.Property(t => t.Discharge_time).HasColumnName("Discharge_time");
            this.Property(t => t.ChronicHeartFailure).HasColumnName("ChronicHeartFailure");
            this.Property(t => t.VascularDisease).HasColumnName("VascularDisease");
            this.Property(t => t.PH_BalloonTime).HasColumnName("PH_BalloonTime");
        }
    }
}
